// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_REP_REPAIR_ORDER_ITEM
// * CreateDate    : 2011-12-14 16:16:41
// * Creater       : CodeSmith
// * LastChangeDate: 2011-12-14 16:16:41
// * LastChanger   : 2011-12-14 16:16:41
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class RepRepairOrderItemEntity : EntityBase
    {
        public RepRepairOrderItemTable TableSchema
        {
            get
            {
                return RepRepairOrderItemTable.Current;
            }
        }

        public RepRepairOrderItemEntity()
        {

        }

        public RepRepairOrderItemEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.RepOrderItemId = Convert.ToString(CommonFunctions.ToObject(dr["REP_ORDER_ITEM_ID"]));
            this.RepOrderId = Convert.ToString(CommonFunctions.ToObject(dr["REP_ORDER_ID"]));
            this.RepApplicationItemId = Convert.ToString(CommonFunctions.ToObject(dr["REP_APPLICATION_ITEM_ID"]));
            this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.FinishedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["FINISHED_QTY"]));
            this.ImportQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["IMPORT_QTY"]));
            this.PlanFinishedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_FINISHED_DATE"]));
            this.RepairReason = Convert.ToString(CommonFunctions.ToObject(dr["REPAIR_REASON"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public RepRepairOrderItemEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.RepOrderItemId = Convert.ToString(CommonFunctions.ToObject(dr["REP_ORDER_ITEM_ID"]));
            this.RepOrderId = Convert.ToString(CommonFunctions.ToObject(dr["REP_ORDER_ID"]));
            this.RepApplicationItemId = Convert.ToString(CommonFunctions.ToObject(dr["REP_APPLICATION_ITEM_ID"]));
            this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.FinishedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["FINISHED_QTY"]));
            this.ImportQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["IMPORT_QTY"]));
            this.PlanFinishedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_FINISHED_DATE"]));
            this.RepairReason = Convert.ToString(CommonFunctions.ToObject(dr["REPAIR_REASON"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return RepRepairOrderItemTable.Current;
            }
        }

        #region Perporty List
        public string RepOrderItemId
        {
            get { return Convert.ToString(GetData(RepRepairOrderItemTable.C_REP_ORDER_ITEM_ID)); }
            set { SetData(RepRepairOrderItemTable.C_REP_ORDER_ITEM_ID, value); }
        }

        public string RepOrderId
        {
            get { return Convert.ToString(GetData(RepRepairOrderItemTable.C_REP_ORDER_ID)); }
            set { SetData(RepRepairOrderItemTable.C_REP_ORDER_ID, value); }
        }

        public string RepApplicationItemId
        {
            get { return Convert.ToString(GetData(RepRepairOrderItemTable.C_REP_APPLICATION_ITEM_ID)); }
            set { SetData(RepRepairOrderItemTable.C_REP_APPLICATION_ITEM_ID, value); }
        }

        public string ProductCode
        {
            get { return Convert.ToString(GetData(RepRepairOrderItemTable.C_PRODUCT_CODE)); }
            set { SetData(RepRepairOrderItemTable.C_PRODUCT_CODE, value); }
        }

        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(RepRepairOrderItemTable.C_QTY)); }
            set { SetData(RepRepairOrderItemTable.C_QTY, value); }
        }

        public decimal FinishedQty
        {
            get { return Convert.ToDecimal(GetData(RepRepairOrderItemTable.C_FINISHED_QTY)); }
            set { SetData(RepRepairOrderItemTable.C_FINISHED_QTY, value); }
        }

        public decimal ImportQty
        {
            get { return Convert.ToDecimal(GetData(RepRepairOrderItemTable.C_IMPORT_QTY)); }
            set { SetData(RepRepairOrderItemTable.C_IMPORT_QTY, value); }
        }

        public DateTime PlanFinishedDate
        {
            get { return Convert.ToDateTime(GetData(RepRepairOrderItemTable.C_PLAN_FINISHED_DATE)); }
            set { SetData(RepRepairOrderItemTable.C_PLAN_FINISHED_DATE, value); }
        }

        public string RepairReason
        {
            get { return Convert.ToString(GetData(RepRepairOrderItemTable.C_REPAIR_REASON)); }
            set { SetData(RepRepairOrderItemTable.C_REPAIR_REASON, value); }
        }

        public string Status
        {
            get { return Convert.ToString(GetData(RepRepairOrderItemTable.C_STATUS)); }
            set { SetData(RepRepairOrderItemTable.C_STATUS, value); }
        }

        #endregion
    }


}

